<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--view层 模板-->
<div id="app">
    <p>currentTime1:{{currentTime1()}}</p>
    <p>currentTime2:{{currentTime2}}</p>
</div>

<!--1、导入vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
    var vm = new Vue({
        el:"#app",
        //Model：数据
        data:{
            message:"hello,vue"
        },
        methods:{
            currentTime1:function() {
                return Date.now()
            }
        },
        //计算属性，methods和computed中的方法名不能重名，重名会优先调用methods
        computed:{
            currentTime2:function() {
                return Date.now()
            }
        }
    });
</script>
</body>
</html>